<%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>

<sec:authorize access="hasRole('ROLE_ADMIN')">
<div class="left_section">
                        <div class="list">
                            <h2 class="blue_head">Admin</h2>
                            <ul>
                            <spring:url value="/customers" var="customerList"  htmlEscape="true"  />
                            <spring:url value="/projects" var="projectsList"  htmlEscape="true"  />
                            <spring:url value="/resources" var="resourcesList"  htmlEscape="true"  />
                            <spring:url value="/resourceallocations" var="resourceallocationsList"  htmlEscape="true"  />
                            <spring:url value="/timehrses" var="timehrsesList"  htmlEscape="true"  />
                            <spring:url value="/useractivitys" var="useractivitysList"  htmlEscape="true"  />
                             
                                <li><a id="menuResourceList" href="${resourcesList}">Resource List</a></li>
                                <li><a id="menuProjectList" href="${projectsList}">Project List </a></li>
                                <li><a id="menuCustomerList" href="${customerList}">Customer List</a></li>
                                <li><a id="menuUserActivityList" href="${useractivitysList}">User Activities</a></li>
                            </ul>
                        </div>
                        <div class="list">
                            <h2 class="blue_head">Transaction</h2>
                            <ul>
                            	<li><a id="menuResourceAllocation" href="${resourceallocationsList}">Resource Allocation</a></li>
                            	<li><a id="menuTimeHoursEntry" href="${timehrsesList}">TimeHours Entry</a></li>
                            </ul>
                        </div>
                        <div class="list">
                            <h2 class="blue_head">Inquiry / Reports</h2>
                            <ul>
                              <li><a href="#"> Reports</a></li>
                            </ul>
                        </div>
                    </div>
                    
                    
                    <script>
                    	$(document).ready(function(){
                    		$('a[id^="menu"]').removeClass('active');
                    		var href = window.location.pathname;
                    		
                    		if (href.toLowerCase().indexOf("customers") >= 0){
                    			$('#menuCustomerList').addClass('active');
                    		}else if (href.toLowerCase().indexOf("projects") >= 0){
                    			$('#menuProjectList').addClass('active');
                    		}else if (href.toLowerCase().indexOf("resources") >= 0){
                    			$('#menuResourceList').addClass('active');
                    		}else if (href.toLowerCase().indexOf("resourceallocations") >= 0){
                    			$('#menuResourceAllocation').addClass('active');
                    		}else if (href.toLowerCase().indexOf("timehrses") >= 0){
                    			$('#menuTimeHoursEntry').addClass('active');
                    		}
                    		
                    		
                    	});
                    </script>
</sec:authorize>